150 DIM CK$[124] : FOR I=1 TO 124 : READ CK$[I] : NEXT
160 DATA END,FOR,NEXT,DATA,INPUT,DIM,READ,LET,GOTO,RUN,IF,RESTORE,GOSUB,RETURN,REM,STOP,PRINT,CLEAR,LIST,NEW,ON,WAIT,DEF,POKE,CONT,"?","?",OUT,LPRINT,LLIST,"?",WIDTH,ELSE
170 DATA TRON,TROFF,SWAP,ERASE,EDIT,ERROR,RESUME,DELETE,AUTO,RENUM,DEFSTR,DEFINT,DEFSNG,DEFDBL,LINE,WHILE,WEND,CALL,"?","?","?",WRITE,OPTION,RANDOMIZE,OPEN,CLOSE,LOAD,MERGE,SAVE,COLOR
180 DATA CLS,MOTOR,BSAVE,BLOAD,SOUND,BEEP,PSET,PRESET,SCREEN,KEY,LOCATE,"?",TO,THEN,TAB(,STEP,USR,FN,SPC(,NOT,ERL,ERR,STRING$,USING,INSTR,"'",VARPTR,CSRLIN,POINT,OFF,INKEY$,"?","?"
190 DATA "?","?","?","?","?",">","=","<","+","-","*","/","^","AND","OR","XOR","EQV","IMP","MOD","\","?","?","?","?","?","?","?","?"
200 DIM CF$[37] : FOR I=1 TO 37 : READ CF$[I] : NEXT
210 DATA LEFT$,RIGHT$,MID$,SGN,INT,ABS,SQR,RND,SIN,LOG,EXP,COS,TAN,ATN,FRE,INP,POS,LEN,STR$,VAL,ASC,CHR$,PEEK,SPACE$,OCT$,HEX$,LPOS,CINT,CSNG,CDBL,FIX,PEN,STICK,STRIG,EOF,LOC,LOF
220 DIM DK$[30] : FOR I=1 TO 30 : READ DK$[I] : NEXT
230 DATA FILES,FIELD,SYSTEM,NAME,LSET,RSET,KILL,PUT,GET,RESET,COMMON,CHAIN,DATE$,TIME$,PAINT,COM,CIRCLE,DRAW,PLAY,TIMER,IOTCTL,MKDIR,SHELL,VIEW,PMAP,ERDEV,CHDIR,RMDIR,ENVIRON,WINDOW
240 DIM DF$[6] : FOR I=1 TO 6 : READ DF$[I] : NEXT
250 DATA CVI,CVS,CVD,MKI$,MKS$,MKD$
260 RETURN
270 '
280 ' *** ASK USER ***
290 INPUT "FILE NAME";X$ : OPEN X$ AS #1 LEN 128 : FIELD #1, 128 AS BB$ : C=129
300 DIM S$[2000],P[2000] 'low memory?
310 PRINT "EACH OF THESE CAN BE LISTED:" : PRINT "KEYWORDS, VARIABLES, LINE NUMBERS, NUMBERS, STRINGS": INPUT "LIST (K,V,L,N,S)";Y$
320 Z$="KVLNS"
330 FOR I=1 TO LEN(Y$) : O[INSTR(Z$,MID$(Y$,I,1))]=-1 : NEXT
340 RETURN
350 '
360 ' *** START UP ***
370 PRINT "ANALYZING"
380 FOR I=1 TO 3:GOSUB 1520:NEXT
390 GOSUB 1520 : B=A : GOSUB 1520 : L=B+256*A
400 PRINT STR$(L); : RETURN
410 '
420 ' *** IDENTIFY TOKENS ***
430 GOSUB 1520:IF EF THEN 1170
440 IF A<128 THEN 630
450 ' *** KEYWORDS ***
460 IF A=143 THEN 550 ' REMARK?
470 IF A=132 THEN 590 ' DATA?
480 IF A<253 THEN X=252 ELSE X=A:GOSUB 1520
490 ON X-251 GOTO 500,510,520,530
500 T$=CK$[A-128]:GOTO 540 ' Cassette keyword
510 T$=DF$[A-128]:GOTO 540 ' Disk function
520 T$=DK$[A-128]:GOTO 540 ' Disk keyword
530 T$=CF$[A-128]:GOTO 540 ' Cassette function
540 T$=T1$+T$:GOTO 1140
550 ' *** REMARK ***
560 T$="":GOSUB 1520:IF A<>217 THEN T$=T$+C$
570 GOSUB 1520:IF 0=A THEN GOSUB 1640 ELSE T$=T$+C$:GOTO 570
580 GOTO 1160
590 ' *** DATA ***
600 T$=""
610 GOSUB 1520:IF 0=A THEN GOSUB 1640 ELSE T$=T$+C$:GOTO 610
620 GOTO 1160
630 IF A<65 OR A>90 THEN 680
640 ' *** NAME ***
650 T$=C$
660 GOSUB 1520:IF(A>64 AND A<91)OR(A>47 AND A<58)OR A=46 OR A=33 OR A=35 OR A=36 OR A=37 THEN T$=T$+C$:GOTO 660 ELSE GOSUB 1640